Gate application result fields by protocol version - #1816
Open
KirschBluteX wants to merge 1 commit into
Open
Conversation
sitihawa140492-byte
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1754.
Summary
Add a single typed response-emission boundary after handlers and filters for protocol-version-specific result properties.
resultTypeand, for cacheable results,ttlMsandcacheScope, and emit a warning when application or filter code supplied them.complete,0, andprivate).The policy is strip plus warning: it keeps legacy wire responses schema-valid and makes application misuse visible, following the SDK's existing compatibility-warning convention without converting otherwise valid requests into errors.
Tests
ModelContextProtocol.slnxRelease build: 0 warnings, 0 errors.trigger-sampling-requesttool; the currentv1image exposessampleLLM. A diagnostic rerun with only that tool name updated passed both Docker tests (2/2); no unrelated fixture change is included here.git diff --checkand targeteddotnet format --verify-no-changespassed for the changed files. Repository-wide format verification still reports existing whitespace diagnostics in untouched files.